# 索引和切片
import torch

X = torch.arange(12).reshape(3, 4)

print(X[-1])
print(X[1:3])
X[1, 2] = 9
print(X)

X[0:1, :] = 9
print(X)